package com.atguigu.member.controll

import com.atguigu.member.service.DwsMemberService
import com.atguigu.util.{BaseControll, HiveUtil}
import org.apache.spark.sql.SparkSession

/**
 * description ：将 dwd 层的数据进行组装宽表
 * author      ：剧情再美终是戏 
 * mail        : 13286520398@163.com
 * date        ：Created in 2020/3/6 15:16
 * modified By ：
 * version:    : 1.0
 */
object DwsMemeberControll extends BaseControll {
  override def initAppName(appName: String) = super.initAppName(DwsMemeberControll.getClass.getName)

  override def doSmething(spark: SparkSession, dt: String, dn: String) = {
    // 开启动态分区和压缩
    HiveUtil.openDynamicPartition(spark)
    HiveUtil.openCompression(spark)

    // 构建 dws_member 宽表
    DwsMemberService.buildDwsMemberWideTable(spark, dt)
    // 构建 dws_member_zipper 拉链表
    DwsMemberService.buildDwsMemberZipper(spark, dt, dn)
  }
}
